; Inno Setup 安装脚本 - clgl打印程序

[Setup]
AppName=clgl打印程序
AppVersion=1.0
DefaultDirName={pf}\clgl打印程序
DefaultGroupName=clgl打印程序
OutputBaseFilename=clgl打印服务安装包
Compression=lzma
SolidCompression=yes
UninstallDisplayIcon={app}\icon.ico
DisableProgramGroupPage=yes

[Files]
Source: "print.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "SumatraPDF-3.5.2-64.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "config.json"; DestDir: "{app}"; Flags: ignoreversion
Source: "icon.ico"; DestDir: "{app}"; Flags: ignoreversion
Source: "icon.png"; DestDir: "{app}"; Flags: ignoreversion
Source: "print_test.html"; DestDir: "{app}"; Flags: ignoreversion

[Icons]
; 在开始菜单中添加服务启动器快捷方式
Name: "{group}\clgl打印程序"; Filename: "{app}\print.exe"; Parameters: ""; WorkingDir: "{app}"; IconFilename: "{app}\icon.ico"
; 在桌面添加快捷方式
Name: "{userdesktop}\clgl打印程序"; Filename: "{app}\print.exe"; Parameters: ""; WorkingDir: "{app}"; IconFilename: "{app}\icon.ico"

[Tasks]
; 添加一个可选项：是否开机自启动
Name: "autostart"; Description: "开机时自动启动 clgl打印程序"; GroupDescription: "其他任务"

[Registry]
; 如果用户选择了 autostart，则将程序添加到注册表启动项
Root: HKCU; Subkey: "Software\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "clgl打印程序"; ValueData: """{app}\print.exe"""; Tasks: autostart

[Run]
; 安装后立即运行（可选）
Filename: "{app}\print.exe"; Description: "启动 clgl打印程序"; Flags: nowait postinstall skipifsilent

[UninstallRun]
; 删除注册表启动项
Filename: "reg"; Parameters: "delete HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v ""clgl打印程序"" /f"; Flags: runhidden
